B.Tech sectioning, per-section grade submission & course feedback - #1941
Merged
vikrantwiz02 merged 12 commits intoAug 2, 2026
Conversation
- Add Student.section (A-F), derived from discipline + roll-number parity via compute_section(); assigned at student onboarding and recomputed on branch change. backfill_sections management command for existing students. - Make CourseInstructor a per-section offering: add section_label and change uniqueness to (course, year, semester_type, section_label) so each section has exactly one owning faculty; single-offering enforcement for electives. - Bind registrations and grades to their offering: add course_instructor FK to course_registration, FinalRegistration and Student_grades; resolve_offering() + binding at verification; bind_course_offerings management command. - Scope grade submission per instructor/section in UploadGradesProfAPI (a faculty may only grade their own section); remove the acadadmin proxy submission path (SubmitGradesView / UploadGradesAPI). - Harden ModerateStudentGradesAPI (term-aware, no MultipleObjectsReturned) and make GradeStatusAPI report status per section. - Make the student roll list (generate_xlsheet_api) section-aware: optional section filter, Section column, section-aware instructor. - Migrations: academic_information 0003, programme_curriculum 0033, academic_procedures 0021, online_cms 0005.
- Add StudentBatchUpload.section, auto-derived in save() from discipline + roll-number parity, so a student's section is decided when data is fed via Admin > Upcoming Batches (recomputed on every save, e.g. when a roll number is later assigned). Auto-exposed by StudentBatchUploadSerializer (fields '__all__'). - Migration: programme_curriculum 0034.
- get_batch_students now includes each student's section in its response so the Upcoming Batches admin view can display it (StudentBatchUpload.section, derived at admission from discipline + roll-number parity).
- New acadadmin Section Assignment API: section/batches, section/students, section/assign - Stop auto-deriving Student.section (onboarding + StudentBatchUpload.save); branch change clears it - get_batch_students shows the assigned section read-only (by roll number) - available_courses exposes per-course sections from enrolled students' Student.section - Faculty assigned-courses API returns each offering's section
- SubmitGradesProfAPI: allow acadadmin (lists all offerings that term) and return per-course sections (faculty = own offerings' section_labels, acadadmin = all); electives/interdisciplinary have none. - UploadGradesProfAPI: allow acadadmin (bypass instructor ownership), accept an optional section to scope the roster; each grade still binds to the student's own offering via resolve_offering. - download_template + PreviewGradesAPI: accept section to scope the roster.
student_questions now resolves each registered course's instructor via resolve_offering (the student's own section offering), falling back to any offering for single-offering / legacy no-section courses.
- FeedbackResponse.course_instructor FK (migration 0022) so responses are tied to the offering rated; student_submit binds it via the shown offering. - student_questions: skip courses with no instructor; show the student's section instructor. - admin_course_list: split sectioned courses into per-instructor rows (+ an "unassigned" row for responses with no offering recorded). - admin_all_stats: filter by course_instructor (incl. isnull); fixed section order.
- GradeStatusAPI: report each offering by its own status; fall back to course-level only when no offering has grades bound (was marking unsubmitted sections as Submitted/Verified). - download_template & PreviewGradesAPI: faculty may only access courses they teach (acadadmin/Dean: any); previously any faculty could pull any roster.
- UploadGradesProfAPI: reset reSubmit only for this submission's roster (never course-wide when programme_type is empty). - student_submit: accept an option only if it belongs to the question, and derive the section from the question instead of trusting the request.
Bring sections up to date with the latest production while keeping its section-aware / per-instructor grade-submission and B.Tech sectioning work. Reconcile examination grade submission: keep section-aware roster scoping and Summer CourseInstructor year handling, and adopt production's selected-role acadadmin detection and registration-based acadadmin course list.
Sections are a UG-only concept (compute_section returns a section only for B.Tech/B.Des). Gate all section handling on programme_type == UG in download_template, UploadGradesProfAPI (section param + per-section roster scoping) and PreviewGradesAPI, so PG/PhD grade submission ignores sections and grades the whole programme's registered students together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the sections work into
prod/acad-react. Branched from the phd-free tip ofsectionsand synced with the latestprod/acad-react, so this PR is sections-only (no phd) and migrates on a fresh DB with no--merge.What's included
Student.section+compute_section; manual assignment via Academics → Section Assignment (auto-derivation removed).CourseInstructor.section_label; registrations/grades bound to their offering viaresolve_offering.Migrations
academic_information
0003, programme_curriculum0033/0034, academic_procedures0021/0022, online_cms0005. Additive; apply cleanly on top ofprod/acad-react(phd not included → no leaf conflict here).Verified
Django
checkclean; migration graph conflict-free. Frontend counterpart: FusionIIIT/Fusion-client (sections-clean → acad-main).